package com.pesking.core.sqlparser.processor;

import java.util.Arrays;
import java.util.List;

import com.pesking.core.parameter.Parameter;
import com.pesking.core.sqlparser.parameter.SqlParameter;
import com.pesking.core.sqlparser.parameter.SqlParameterProcessor;
import com.pesking.core.utils.ThisServerUtil;

public class ContextPathParameterSqlHandler extends SqlParameterProcessor {


	@Override
	public List<String> getSqlParameterType() {
		return Arrays.asList(new String []{"CONTEXT_PATH"});
	}

	@Override
	public int getOrder() {
		return 0;
	}

	@Override
	public void handle(StringBuilder sbSQL, Parameter parameter,List<SqlParameter> processors,SqlParameter sqlParameter) {
		String cp = ThisServerUtil.getContextPath();
		sbSQL.append("'").append(cp).append("'");
	}
	
	
}
